package jjn.effective_java.chapter6.item34;

/**
 * @author Jiang Jining
 * @since 2023-04-26 23:56
 */
public enum PayRollDayV2 {
    MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY(PayType.WEEKEND), SUNDAY(PayType.WEEKEND);
    private final PayType payType;
    
    PayRollDayV2(final PayType payType) {
        this.payType = payType;
    }
    
    PayRollDayV2() {
        this(PayType.WEEKDAY);
    }
    
    int pay(int minutesWorked, int payRate) {
        return payType.pay(minutesWorked, payRate);
    }
}
